-
Notifications
You must be signed in to change notification settings - Fork 44
Update product attributes and metadata.yml with cube metadata before saving files
#1837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1837 +/- ##
=======================================
Coverage 91.54% 91.54%
=======================================
Files 203 203
Lines 10945 10945
=======================================
Hits 10020 10020
Misses 925 925 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
|
@bouweandela this is possible solution to #505. In your comment you mentioned also adapting frequencies accordingly. I thought about this some time now and found several possible solutions for this:
In addition, I have some questions:
All these problems lead me to the conclusion that it might be best to tackle the frequency update at a later stage. This PR solves an actual existing problem, whereas no one complained about wrong frequencies before. So maybe just open an issue about this and merge this without adapting the frequencies? @ESMValGroup/esmvaltool-coreteam any opinions? |
|
My idea wasn't nearly as advanced as that: i thought we could just update the frequency in metadata.yml using the value of the Prepeocessors who change the frequency or any of the other attributes should then take care of updating the appropriate cube attributes. |
|
Right - that's much easier indeed. Two questions on this:
|
I would leave that for a new pull request.
No, just the ones that are wrong after preprocessing. |
|
All right, implemented. One remaining question: Currently, if a cube property (e.g., However, in the light of preprocessors that completely remove cube metadata (#651), this might lead to unexpected results. Would it be safer to just not update the corresponding values if it's |
|
Corresponding frequency issue: #1840 |
bouweandela
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good @schlunma! I tested this with the convert_units preprocessor function and that works fine now.
Co-authored-by: Bouwe Andela <b.andela@esciencecenter.nl>
valeriupredoi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cheers guys - am the merger, so I am not requesting any changes, but I have a couple questions before I merge this piece of art 😁
|
thanks a lot @schlunma and @bouweandela 🍺 |
Description
This PR adds a function that updates the product attributes (and thus the
metadata.ymlfiles) with cube metadata before saving files. This ensures that the entries inmetadata.ymlmatch the cube metadata.Currently modified metadata:
standard_namefromcube.standard_namelong_namefromcube.long_namevar_namefromcube.short_nameunitsfromcube.unitsfrequencyfromcube.attributes['frequency']Closes #505
Documentation: https://esmvaltool--1837.org.readthedocs.build/projects/ESMValCore/en/1837/develop/preprocessor_function.html#metadata
Before you get started
Checklist
It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.
To help with the number pull requests: